using Microsoft.VisualStudio.Modeling.Diagrams;

namespace Microsoft.Modeling.StoryboardDesigner
{
    /// <summary>
    /// Mappings for the new MultiLineCompartment shape.
    /// </summary>
    /// <remarks>Can map a multiline compartment to a single
    /// text field. You specify the delegates that are called to
    /// get and set the property value as part of this mapping.</remarks>
    public partial class MultiLineCompartmentMapping : CompartmentMapping
    {
        public MultiLineCompartmentMapping(string compartmentId)
            : base(compartmentId)
        {
        }

        protected override void InitializeCompartment(Compartment compartment)
        {
            MultiLineCompartment mlComp = compartment as MultiLineCompartment;

            // Not the compartment type we are looking for
            if(mlComp == null)
            {
                return;
            }

            mlComp.UpdateSize();
            compartment.Invalidate();
        }
    }
}